import { S } from '../../s';
import { IPSControlAttribute } from '../ipscontrol-attribute';
import { IPSControlLogic } from '../ipscontrol-logic';
import { IPSControlRender } from '../ipscontrol-render';
import { IPSChartAxis } from './ipschart-axis';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEChartAxisImplBase
  extends PSModelObjectImpl
  implements IPSChartAxis
{
  get baseOptionJOString(): string {
    return this.M.baseOptionJOString;
  }

  protected cappslanguageres: IPSLanguageRes;
  getCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.cappslanguageres ||
      (this.cappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getCapPSLanguageRes,
        S._2a8,
      ) as IPSLanguageRes)
    );
  }

  get caption(): string {
    return this.M.caption;
  }

  get dataShowMode(): 0 | 1 | 2 | 3 {
    return this.M.dataShowMode != null ? this.M.dataShowMode : 0;
  }

  get eChartsPos(): string {
    return this.M.eChartsPos;
  }

  get eChartsType(): string {
    return this.M.eChartsType;
  }

  get index(): number {
    return this.M.index;
  }

  get maxValue(): number {
    return this.M.maxValue;
  }

  get minValue(): number {
    return this.M.minValue;
  }

  protected pscontrolattributes: IPSControlAttribute[];
  getPSControlAttributes(): IPSControlAttribute[] | null {
    return (
      this.pscontrolattributes ||
      (this.pscontrolattributes = this.fillChildListModel(
        this.M.getPSControlAttributes,
        S._3f5,
      ) as IPSControlAttribute[])
    );
  }

  findPSControlAttribute(objKey: any): IPSControlAttribute | null {
    return this.getPSModel5(
      S._3f5,
      this.getPSControlAttributes(),
      objKey,
    ) as IPSControlAttribute;
  }

  protected pscontrollogics: IPSControlLogic[];
  getPSControlLogics(): IPSControlLogic[] | null {
    return (
      this.pscontrollogics ||
      (this.pscontrollogics = this.fillChildListModel(
        this.M.getPSControlLogics,
        S._38d,
      ) as IPSControlLogic[])
    );
  }

  findPSControlLogic(objKey: any): IPSControlLogic | null {
    return this.getPSModel5(
      S._38d,
      this.getPSControlLogics(),
      objKey,
    ) as IPSControlLogic;
  }

  protected pscontrolrenders: IPSControlRender[];
  getPSControlRenders(): IPSControlRender[] | null {
    return (
      this.pscontrolrenders ||
      (this.pscontrolrenders = this.fillChildListModel(
        this.M.getPSControlRenders,
        S._3f6,
      ) as IPSControlRender[])
    );
  }

  findPSControlRender(objKey: any): IPSControlRender | null {
    return this.getPSModel5(
      S._3f6,
      this.getPSControlRenders(),
      objKey,
    ) as IPSControlRender;
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  get position(): 'left' | 'bottom' | 'right' | 'top' | 'radial' | 'angular' {
    return this.M.position;
  }

  get type(): 'numeric' | 'time' | 'category' | 'log' {
    return this.M.type;
  }
  get cls(): string {
    return 'PSDEChartAxisImplBase';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3f7 || cls == S._dd) return true;
    return super.instanceof(cls);
  }
}
